﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity.Migrations;
using MusicLibrary.DataModels;

namespace MusicLibrary.Data
{
    public class Seeder
    {
        public static void Seed(ApplicationDbContext db, bool seedAlbums = true, bool seedSongs = true)
        {
            if (seedAlbums)
            {
                db.Albums.AddOrUpdate(
                    a => a.Title,
                    new Album("The Great Gatbsy Album", "This album contains one the greatest film soundtracks of all time, coming to you from Baz Luhrmann's film, The Great Gatsby, featuring artists such as Lana Del Rey and more!", "Baz Luhrmann - Multiple Artists", "http://soulculture.com/wp-content/uploads/the-great-gatsby-soundtrack.jpg"),
                    new Album("College Dropout", "The College Dropout is the debut album by American hip hop artist Kanye West, released February 10, 2004, on Roc-A-Fella Records. It's overall theme was to 'make your own decisions. Don't let society tell you, This is what you have to do.'", "Kanye West", "http://www.xxlmag.com/wp-content/uploads/2013/09/The-College-Dropout.jpg")
                    );
                db.SaveChanges();
            }

            if (seedSongs)
            {
                db.Songs.AddOrUpdate(
                    s => s.Title,
                    new Song("Young and Beautiful", "Lana Del Rey", "Baroque pop", "0x1Go5IvLw", 1),
                    new Song("No Church in the Wild", "Kanye West, JAY-Z, Frank Ocean, The-Dream", "Hip Hop, Rap", "F7CVDKkff4c", 1),
                    new Song("We Don't Care", "Kanye West", "Hip Hop, Rap", "4WezusURMbY", 2),
                    new Song("Family Business", "Kanye West", "Hip Hop, Rap", "0FtrbhfhWg", 2)
                    );
                db.SaveChanges();
            }
        }
    }
}
